﻿<Window x:Class="Cipher.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Cipher"
        Title="Cipher" MinHeight="350" MinWidth="525" Height="350" Width="525"
        Icon="cipher.ico">
    <Window.Resources>
        <Style TargetType="Button">
            <Setter Property="Padding" Value="5" />
        </Style>
    </Window.Resources>
    
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>

        <Grid Margin="0,0,0,10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            
            <StackPanel Orientation="Horizontal">
                <ComboBox Name="cbCiphers" VerticalContentAlignment="Center"></ComboBox>
                <Label Name="lblkey" Target="{Binding ElementName=txtbxKey}">_Shift:</Label>
                <TextBox Name="tbKey" Width="100" VerticalContentAlignment="Center"/>                
            </StackPanel>
            
            <StackPanel Orientation="Horizontal" Grid.Column="1">
                <Button Name="btnEncrypt" Margin="10,0,0,0">Encrypt</Button>
                <Button Name="btnDecrypt" Margin="10,0,0,0">Decrypt</Button>
                <Button Name="btnGetKey" Margin="10,0,0,0" IsEnabled="False">Get Key</Button>
            </StackPanel>
        </Grid>
        
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            
            <Label Target="{Binding ElementName=tbInput}">_Plain text:</Label>
            <Label Grid.Column="2" Target="{Binding ElementName=tbOutput}">_Ciphered text:</Label>
            
            <TextBox Name="tbInput" Grid.Row="1" AcceptsReturn="True" AcceptsTab="False"
                     TextWrapping="Wrap" KeyUp="tb_KeyUp" />
                 
            <Button Name="btnSwap" Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" Margin="10"
                    Padding="0" BorderThickness="0" Background="Transparent">
                <Image Source="Images/swap.png" Width="30" />
            </Button>
            
            <TextBox Name="tbOutput" Grid.Column="2" Grid.Row="1" AcceptsReturn="True" AcceptsTab="False"
                     TextWrapping="Wrap" KeyUp="tb_KeyUp" />            
        </Grid>
    </Grid>
</Window>
